package com.example.daxiguaforharmony.slice;

import com.example.daxiguaforharmony.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.ScrollView;
import ohos.agp.components.Text;
import ohos.agp.components.webengine.WebView;
import ohos.agp.window.service.WindowManager;
import ohos.bundle.AbilityInfo;

/**
 * Full screen ability slice
 */
public class InstructionAbilitySlice extends AbilitySlice {
    @Override
    public void onStart(Intent intent) {
        super.onStart(intent);

        // hide status bar
        this.getWindow().addFlags(WindowManager.LayoutConfig.MARK_ALLOW_EXTEND_LAYOUT);
        this.getWindow().addFlags(WindowManager.LayoutConfig.MARK_FULL_SCREEN);

        this.setUIContent(ResourceTable.Layout_instruction);

        Text desc = (Text) findComponentById(ResourceTable.Id_txt_desc);
        String str = "玩法说明:\n" +
                "    合并相同的水果，可以生成一个新的更大的水果, 最后合成大西瓜，从中获得的合成乐趣；" +
                "游戏通过关卡后不断解锁新的水果，关卡难度也因解锁新的水果不断增加挑战性；" +
                "通关后也可以获得关卡奖励, 继续挑战关卡。闯关的过程中一会解锁新的道具，使用新的道具可以帮你快速的通过关卡，" +
                "使之更加有乐趣。通过鸿蒙多设备协同和分布式存储功能更可以与好友同台竞技，实时得分显示，使游戏过程更加充满刺激紧张感。\n" +
                "";
        desc.setText(str);

        //ScrollView scrollview = (ScrollView) findComponentById(ResourceTable.Id_scrollview);
        //scrollview.setReboundEffectParams(1,(float) 0.1,1);


    }

    @Override
    protected void onOrientationChanged(AbilityInfo.DisplayOrientation displayOrientation) {
        super.onOrientationChanged(displayOrientation);
    }

    @Override
    public void onActive() {
        super.onActive();
    }

    @Override
    public void onForeground(Intent intent) {
        super.onForeground(intent);
    }
}
